package cn.iocoder.yudao.module.jikong.dal.mysql.backup;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.jikong.dal.dataobject.backup.BackupDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.jikong.controller.admin.backup.vo.*;

/**
 * 数据库备份 Mapper
 *
 * @author admin
 */
@Mapper
public interface BackupMapper extends BaseMapperX<BackupDO> {

    default PageResult<BackupDO> selectPage(BackupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BackupDO>()
                .likeIfPresent(BackupDO::getSqlName, reqVO.getSqlName())
                .eqIfPresent(BackupDO::getFilePath, reqVO.getFilePath())
                .eqIfPresent(BackupDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(BackupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BackupDO::getId));
    }

}